image_names=("fang/blog/config-server" "fang/blog/discovery" "fang/blog/user" "fang/blog/api-gateway");


#delete images if exist
for image_name in ${image_names[@]};do
    if docker images -a | grep -i $image_name; then
        echo "docker rmi -f $image_name" ;
        docker rmi -f $image_name
    fi
done

#delete dangling images
docker rmi $(docker images -f "dangling=true" -q)
